package com.example.mytayunapi.Controller;

import com.example.mytayunapi.Entity.CommentsInfo;
import com.example.mytayunapi.Service.CommentsInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("set")
public class CommentsController {
    @Autowired
    private CommentsInfoService commentsInfoService;

    //http://localhost:8080/set/inter
    @PostMapping("/inter")
    public Integer inter(@RequestBody CommentsInfo commentsInfo) {
        return commentsInfoService.insterComments(commentsInfo);
    }

    //http://localhost:8080/set/remark
    @GetMapping("/remark")
    public List<CommentsInfo> remark(@RequestParam String CommentID) {
        return commentsInfoService.getCommentsInfoByCommentID(CommentID);
    }

}
